package Demo3;

import java.util.Comparator;

//实现Comparator接口
public class ComparePerson implements Comparator<Person> {
    @Override
    public int compare(Person o1, Person o2) {
        return o1.age - o2.age;
    }
}
